package com.xnyzc.lhy.common.penum;


public enum EDispatchType {
    // 接到订单
    createOrderBefore(1, "createOrderBefore"),
    // 创建抢单以后
    createOrderAfter(2, "createOrderAfter"),
    // 开始调度
    dispatchDriverBefore(3, "dispatchDriverBefore"),
    //调度结束
    dispatchDriverAfter(4, "dispatchDriverAfter"),
    // 抢单开始
    grabOrdersBefore(5, "grabOrdersBefore"),
    // 接单结束
    grabOrdersAfter(6, "grabOrdersAfter"),
    // 订单同步
    orderSynchronize(7, "orderSynchronize"),
    //调度超时
    dispatchDriverTimeOut(8, "dispatchDriverTimeOut");
    private Integer type;

    private String desc;

    EDispatchType(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public static String findDescByType(Integer type) {
        EDispatchType[] dispatchTypes = values();
        for (EDispatchType dispatchType : dispatchTypes) {
            if (dispatchType.type.equals(type)) {
                return dispatchType.desc;
            }
        }
        return "";
    }

    public String getDesc() {
        return desc;
    }
}
